#ifndef _CONTROLLER_H_
#define _CONTROLLER_H_

#include "tableFlipper.h"

#define MAX_UNDO 100

#define CEBadArgument		-1
#define CEStackOverFlow 	-2
#define CEFileNotFound		-3
#define CEBadFile			-4
#define CEBadAlloc			-5
#define CEUndefinedError	-6
#define CESuccess		 	 0
#define CEExit				 1

#define UNKNOWN 0
#define LEFT    1
#define RIGHT   -1
#define UP      2
#define DOWN    -2
#define REVX    3
#define REVY    -3
#define CRND    7
#define SWAP    8
#define UNDO    9
#define REDO    10
#define SAVE    11
#define EXIT    12

#define BUFFSIZE			 100

typedef int error_t;

typedef struct strnode{
	struct strnode* left;
	struct strnode* right;
	int key;
} node;


void    cgetline(char* buffer, ssize_t size, FILE* fp);
error_t initController(cpny_t* cpny);
error_t cexec(char* command, cpny_t* cpny);

#endif
